package leecode

func minOperations1827(nums []int) int {
	var result int
	for i := 0; i+1 < len(nums); i++ {
		if nums[i+1] <= nums[i] {
			result += nums[i] - nums[i+1] + 1
			nums[i+1] = nums[i] + 1
		}
	}
	return result
}
